
#ifndef _HULUWA_EXCEPTION_HPP_
#define _HULUWA_EXCEPTION_HPP_

#include <string>
#include <exception>
#include <boost/exception/exception.hpp>

namespace huluwa {

/** 
 * @brief   Huluwa exception base class.
 */
class Exception 
    : virtual std::exception, virtual boost::exception {

public:
    /// Construct with error message
    Exception(const std::string& msg) throw()
        : msg_(msg)
    {
    }

    /// Construct with error message.
    Exception(const char *msg) throw()
        :msg_(msg)
    {
    }

    /// Virtual Destructor.
    virtual ~Exception() throw() {};

    /// Return error message.
    virtual const std::string& What() const throw()
    {
        return msg_;
    }

    /// Return error message.
    virtual const char *what() const throw()
    {
        return msg_.c_str();
    }

private:
    std::string msg_;
};

} // namespace huluwa

#endif 
